package com.ai.tikai.service;

import com.ai.tikai.entity.Comments;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "comments-service", url = "http://localhost:8081")
public interface CommentsFeignClient {
    /**
     * 声明一个方法，其注解和签名与目标Controller完全对应
     */
    @GetMapping("/comments/{id}")
    Comments getCommentById(@PathVariable("id") Long id);

    @PutMapping("/comments/update")
    String updateComment(@RequestBody Comments comment);
}
